home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 November / Freeware November 1998.img / dist / fw_emacs.idb / usr / freeware / info / emacs-17.z / emacs-17 (.txt)
GNU Info File  |  1998-10-27  |  47KB  |  872 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Dired Updating,  Next: Dired and Find,  Prev: Hiding Subdirectories,  Up: Dired
  4. Updating the Dired Buffer
  5. =========================
  6.    This section describes commands to update the Dired buffer to reflect
  7. outside (non-Dired) changes in the directories and files, and to delete
  8. part of the Dired buffer.
  9.      Update the entire contents of the Dired buffer (`revert-buffer').
  10.      Update the specified files (`dired-do-redisplay').
  11.      Delete the specified *file lines*--not the files, just the lines
  12.      (`dired-do-kill-lines').
  13.      Toggle between sorting by file name and sorting by date/time
  14.      (`dired-sort-toggle-or-edit').
  15. `C-u s SWITCHES RET'
  16.      Refresh the Dired buffer using SWITCHES as
  17.      `dired-listing-switches'.
  18.    Type `g' (`revert-buffer') to update the contents of the Dired
  19. buffer, based on changes in the files and directories listed.  This
  20. preserves all marks except for those on files that have vanished.
  21. Hidden subdirectories are updated but remain hidden.
  22.    To update only some of the files, type `l' (`dired-do-redisplay').
  23. This command applies to the next N files, or to the marked files if
  24. any, or to the current file.  Updating them means reading their current
  25. status from the file system and changing the buffer to reflect it
  26. properly.
  27.    If you use `l' on a subdirectory header line, it updates the
  28. contents of the corresponding subdirectory.
  29.    To delete the specified *file lines*--not the files, just the
  30. lines--type `k' (`dired-do-kill-lines').  This command applies to the
  31. next N files, or to the marked files if any, or to the current file.
  32.    If you kill the line for a file that is a directory, the directory's
  33. contents are also deleted from the buffer.  Typing `C-u k' on the
  34. header line for a subdirectory is another way to delete a subdirectory
  35. from the Dired buffer.
  36.    The `g' command brings back any individual lines that you have
  37. killed in this way, but not subdirectories--you must use `i' to
  38. reinsert each subdirectory.
  39.    The files in a Dired buffers are normally in listed alphabetical
  40. order by file names.  Alternatively Dired can sort them by date/time.
  41. The Dired command `s' (`dired-sort-toggle-or-edit') switches between
  42. these two sorting modes.  The mode line in a Dired buffer indicates
  43. which way it is currently sorted--by name, or by date.
  44.    `C-u s SWITCHES RET' lets you specify a new value for
  45. `dired-listing-switches'.
  46. File: emacs,  Node: Dired and Find,  Prev: Dired Updating,  Up: Dired
  47. Dired and `find'
  48. ================
  49.    You can select a set of files for display in a Dired buffer more
  50. flexibly by using the `find' utility to choose the files.
  51.    To search for files with names matching a wildcard pattern use `M-x
  52. find-name-dired'.  It reads arguments DIRECTORY and PATTERN, and
  53. chooses all the files in DIRECTORY or its subdirectories whose
  54. individual names match PATTERN.
  55.    The files thus chosen are displayed in a Dired buffer in which the
  56. ordinary Dired commands are available.
  57.    If you want to test the contents of files, rather than their names,
  58. use `M-x find-grep-dired'.  This command reads two minibuffer
  59. arguments, DIRECTORY and REGEXP; it chooses all the files in DIRECTORY
  60. or its subdirectories that contain a match for REGEXP.  It works by
  61. running the programs `find' and `grep'.
  62.    The most general command in this series is `M-x find-dired', which
  63. lets you specify any condition that `find' can test.  It takes two
  64. minibuffer arguments, DIRECTORY and FIND-ARGS; it runs `find' in
  65. DIRECTORY, passing FIND-ARGS to tell `find' what condition to test.  To
  66. use this command, you need to know how to use `find'.
  67.    The format of listing produced by these commands is controlled by the
  68. variable `find-ls-option', whose default value specifies using options
  69. `-ldi' for `ls'.  If your listings are corrupted, you may need to
  70. change the value of this variable.
  71. File: emacs,  Node: Calendar/Diary,  Next: Gnus,  Prev: Dired,  Up: Top
  72. The Calendar and the Diary
  73. **************************
  74.    Emacs provides the functions of a desk calendar, with a diary of
  75. planned or past events.  To enter the calendar, type `M-x calendar';
  76. this displays a three-month calendar centered on the current month, with
  77. point on the current date.  With a numeric argument, as in `C-u M-x
  78. calendar', it prompts you for the month and year to be the center of the
  79. three-month calendar.  The calendar uses its own buffer, whose major
  80. mode is Calendar mode.
  81.    `Mouse-2' in the calendar brings up a menu of operations on a
  82. particular date; `C-Mouse-3' brings up a menu of commonly used calendar
  83. features that are independent of any particular date.  To exit the
  84. calendar, type `q'.  *Note Customizing the Calendar and Diary:
  85. (elisp)Calendar, for customization information about the calendar and
  86. diary.
  87. * Menu:
  88. * Calendar Motion::       Moving through the calendar; selecting a date.
  89. * Scroll Calendar::       Bringing earlier or later months onto the screen.
  90. * Counting Days::         How many days are there between two dates?
  91. * General Calendar::      Exiting or recomputing the calendar.
  92. * TeX Calendar::          Print a calendar using TeX.
  93. * Holidays::              Displaying dates of holidays.
  94. * Sunrise/Sunset::        Displaying local times of sunrise and sunset.
  95. * Lunar Phases::          Displaying phases of the moon.
  96. * Other Calendars::       Converting dates to other calendar systems.
  97. * Diary::                 Displaying events from your diary.
  98. * Appointments::      Reminders when it's time to do something.
  99. * Daylight Savings::      How to specify when daylight savings time is active.
  100. File: emacs,  Node: Calendar Motion,  Next: Scroll Calendar,  Up: Calendar/Diary
  101. Movement in the Calendar
  102. ========================
  103.    Calendar mode lets you move through the calendar in logical units of
  104. time such as days, weeks, months, and years.  If you move outside the
  105. three months originally displayed, the calendar display "scrolls"
  106. automatically through time to make the selected date visible.  Moving to
  107. a date lets you view its holidays or diary entries, convert it to other
  108. calendars; moving longer time periods is also useful simply to scroll
  109. the calendar.
  110. * Menu:
  111. * Calendar Unit Motion::      Moving by days, weeks, months, and years.
  112. * Move to Beginning or End::  Moving to start/end of weeks, months, and years.
  113. * Specified Dates::           Moving to the current date or another
  114.                                 specific date.
  115. File: emacs,  Node: Calendar Unit Motion,  Next: Move to Beginning or End,  Up: Calendar Motion
  116. Motion by Standard Lengths of Time
  117. ----------------------------------
  118.    The commands for movement in the calendar buffer parallel the
  119. commands for movement in text.  You can move forward and backward by
  120. days, weeks, months, and years.
  121. `C-f'
  122.      Move point one day forward (`calendar-forward-day').
  123. `C-b'
  124.      Move point one day backward (`calendar-backward-day').
  125. `C-n'
  126.      Move point one week forward (`calendar-forward-week').
  127. `C-p'
  128.      Move point one week backward (`calendar-backward-week').
  129. `M-}'
  130.      Move point one month forward (`calendar-forward-month').
  131. `M-{'
  132.      Move point one month backward (`calendar-backward-month').
  133. `C-x ]'
  134.      Move point one year forward (`calendar-forward-year').
  135. `C-x ['
  136.      Move point one year backward (`calendar-forward-year').
  137.    The day and week commands are natural analogues of the usual Emacs
  138. commands for moving by characters and by lines.  Just as `C-n' usually
  139. moves to the same column in the following line, in Calendar mode it
  140. moves to the same day in the following week.  And `C-p' moves to the
  141. same day in the previous week.
  142.    The arrow keys are equivalent to `C-f', `C-b', `C-n' and `C-p', just
  143. as they normally are in other modes.
  144.    The commands for motion by months and years work like those for
  145. weeks, but move a larger distance.  The month commands `M-}' and `M-{'
  146. move forward or backward by an entire month's time.  The year commands
  147. `C-x ]' and `C-x [' move forward or backward a whole year.
  148.    The easiest way to remember these commands is to consider months and
  149. years analogous to paragraphs and pages of text, respectively.  But the
  150. commands themselves are not quite analogous.  The ordinary Emacs
  151. paragraph commands move to the beginning or end of a paragraph, whereas
  152. these month and year commands move by an entire month or an entire
  153. year, which usually involves skipping across the end of a month or year.
  154.    All these commands accept a numeric argument as a repeat count.  For
  155. convenience, the digit keys and the minus sign specify numeric
  156. arguments in Calendar mode even without the Meta modifier.  For example,
  157. `100 C-f' moves point 100 days forward from its present location.
  158. File: emacs,  Node: Move to Beginning or End,  Next: Specified Dates,  Prev: Calendar Unit Motion,  Up: Calendar Motion
  159. Beginning or End of Week, Month or Year
  160. ---------------------------------------
  161.    A week (or month, or year) is not just a quantity of days; we think
  162. of weeks (months, years) as starting on particular dates.  So Calendar
  163. mode provides commands to move to the beginning or end of a week, month
  164. or year:
  165. `C-a'
  166.      Move point to start of week (`calendar-beginning-of-week').
  167. `C-e'
  168.      Move point to end of week (`calendar-end-of-week').
  169. `M-a'
  170.      Move point to start of month (`calendar-beginning-of-month').
  171. `M-e'
  172.      Move point to end of month (`calendar-end-of-month').
  173. `M-<'
  174.      Move point to start of year (`calendar-beginning-of-year').
  175. `M->'
  176.      Move point to end of year (`calendar-end-of-year').
  177.    These commands also take numeric arguments as repeat counts, with the
  178. repeat count indicating how many weeks, months, or years to move
  179. backward or forward.
  180.    By default, weeks begin on Sunday.  To make them begin on Monday
  181. instead, set the variable `calendar-week-start-day' to 1.
  182. File: emacs,  Node: Specified Dates,  Prev: Move to Beginning or End,  Up: Calendar Motion
  183. Specified Dates
  184. ---------------
  185.    Calendar mode provides commands for moving to a particular date
  186. specified in various ways.
  187. `g d'
  188.      Move point to specified date (`calendar-goto-date').
  189.      Center calendar around specified month (`calendar-other-month').
  190.      Move point to today's date (`calendar-goto-today').
  191.    `g d' (`calendar-goto-date') prompts for a year, a month, and a day
  192. of the month, and then moves to that date.  Because the calendar
  193. includes all dates from the beginning of the current era, you must type
  194. the year in its entirety; that is, type `1990', not `90'.
  195.    `o' (`calendar-other-month') prompts for a month and year, then
  196. centers the three-month calendar around that month.
  197.    You can return to today's date with `.' (`calendar-goto-today').
  198. File: emacs,  Node: Scroll Calendar,  Next: Counting Days,  Prev: Calendar Motion,  Up: Calendar/Diary
  199. Scrolling in the Calendar
  200. =========================
  201.    The calendar display scrolls automatically through time when you
  202. move out of the visible portion.  You can also scroll it manually.
  203. Imagine that the calendar window contains a long strip of paper with
  204. the months on it.  Scrolling it means moving the strip so that new
  205. months become visible in the window.
  206. `C-x <'
  207.      Scroll calendar one month forward (`scroll-calendar-left').
  208. `C-x >'
  209.      Scroll calendar one month backward (`scroll-calendar-right').
  210. `C-v'
  211. `NEXT'
  212.      Scroll calendar three months forward
  213.      (`scroll-calendar-left-three-months').
  214. `M-v'
  215. `PRIOR'
  216.      Scroll calendar three months backward
  217.      (`scroll-calendar-right-three-months').
  218.    The most basic calendar scroll commands scroll by one month at a
  219. time.  This means that there are two months of overlap between the
  220. display before the command and the display after.  `C-x <' scrolls the
  221. calendar contents one month to the left; that is, it moves the display
  222. forward in time.  `C-x >' scrolls the contents to the right, which
  223. moves backwards in time.
  224.    The commands `C-v' and `M-v' scroll the calendar by an entire
  225. "screenful"--three months--in analogy with the usual meaning of these
  226. commands.  `C-v' makes later dates visible and `M-v' makes earlier
  227. dates visible.  These commands take a numeric argument as a repeat
  228. count; in particular, since `C-u' multiplies the next command by four,
  229. typing `C-u C-v' scrolls the calendar forward by a year and typing `C-u
  230. M-v' scrolls the calendar backward by a year.
  231.    The function keys NEXT and PRIOR are equivalent to `C-v' and `M-v',
  232. just as they are in other modes.
  233. File: emacs,  Node: Counting Days,  Next: General Calendar,  Prev: Scroll Calendar,  Up: Calendar/Diary
  234. Counting Days
  235. =============
  236. `M-='
  237.      Display the number of days in the current region
  238.      (`calendar-count-days-region').
  239.    To determine the number of days in the region, type `M-='
  240. (`calendar-count-days-region').  The numbers of days printed is
  241. *inclusive*; that is, it includes the days specified by mark and point.
  242. File: emacs,  Node: General Calendar,  Next: TeX Calendar,  Prev: Counting Days,  Up: Calendar/Diary
  243. Miscellaneous Calendar Commands
  244. ===============================
  245. `p d'
  246.      Display day-in-year (`calendar-print-day-of-year').
  247. `C-c C-l'
  248.      Regenerate the calendar window (`redraw-calendar').
  249. `SPC'
  250.      Scroll the next window (`scroll-other-window').
  251.      Exit from calendar (`exit-calendar').
  252.    To print the number of days elapsed since the start of the year, or
  253. the number of days remaining in the year, type the `p d' command
  254. (`calendar-print-day-of-year').  This displays both of those numbers in
  255. the echo area.  The number of days elapsed includes the selected date.
  256. The number of days remaining does not include that date.
  257.    If the calendar window text gets corrupted, type `C-c C-l'
  258. (`redraw-calendar') to redraw it.  (This can only happen if you use
  259. non-Calendar-mode editing commands.)
  260.    In Calendar mode, you can use `SPC' (`scroll-other-window') to
  261. scroll the other window.  This is handy when you display a list of
  262. holidays or diary entries in another window.
  263.    To exit from the calendar, type `q' (`exit-calendar').  This buries
  264. all buffers related to the calendar, selecting other buffers.  (If a
  265. frame contains a dedicated calendar window, exiting from the calendar
  266. iconifies that frame.)
  267. File: emacs,  Node: TeX Calendar,  Next: Holidays,  Prev: General Calendar,  Up: Calendar/Diary
  268. TeX Calendar
  269. ============
  270.    The Calendar TeX commands produce a buffer of LaTeX code that prints
  271. as a calendar.  Depending on the command you use, the printed calendar
  272. covers the day, week, month or year that point is in.
  273. `t m'
  274.      Generate a one-month calendar (`cal-tex-cursor-month').
  275. `t M'
  276.      Generate a sideways-printing one-month calendar
  277.      (`cal-tex-cursor-month-landscape').
  278. `t d'
  279.      Generate a one-day calendar (`cal-tex-cursor-day').
  280. `t w 1'
  281.      Generate a one-page calendar for one week (`cal-tex-cursor-week').
  282. `t w 2'
  283.      Generate a two-page calendar for one week (`cal-tex-cursor-week2').
  284. `t w 3'
  285.      Generate an ISO-style calendar for one week
  286.      (`cal-tex-cursor-week-iso').
  287. `t w 4'
  288.      Generate a calendar for one Monday-starting week
  289.      (`cal-tex-cursor-week-monday').
  290. `t f w'
  291.      Generate a Filofax-style two-weeks-at-a-glance calendar
  292.      (`cal-tex-cursor-filofax-2week').
  293. `t f W'
  294.      Generate a Filofax-style one-week-at-a-glance calendar
  295.      (`cal-tex-cursor-filofax-week').
  296. `t y'
  297.      Generate a calendar for one year (`cal-tex-cursor-year').
  298. `t Y'
  299.      Generate a sideways-printing calendar for one year
  300.      (`cal-tex-cursor-landscape-year').
  301. `t f y'
  302.      Generate a Filofax-style calendar for one year
  303.      (`cal-tex-cursor-filofax-year').
  304.    Some of these commands print the calendar sideways (in "landscape
  305. mode"), so it can be wider than it is long.  Some of them use Filofax
  306. paper size (3.75in x 6.75in).  All of these commands accept a prefix
  307. argument which specifies how many days, weeks, months or years to print
  308. (starting always with the selected one).
  309.    If the variable `cal-tex-holidays' is non-`nil' (the default), then
  310. the printed calendars show the holidays in `calendar-holidays'.  If the
  311. variable `cal-tex-diary' is non-`nil' (the default is `nil'), diary
  312. entries are included also (in weekly and monthly calendars only).
  313. File: emacs,  Node: Holidays,  Next: Sunrise/Sunset,  Prev: TeX Calendar,  Up: Calendar/Diary
  314. Holidays
  315. ========
  316.    The Emacs calendar knows about all major and many minor holidays,
  317. and can display them.
  318.      Display holidays for the selected date
  319.      (`calendar-cursor-holidays').
  320. `Mouse-2 Holidays'
  321.      Display any holidays for the date you click on.
  322.      Mark holidays in the calendar window (`mark-calendar-holidays').
  323.      Unmark calendar window (`calendar-unmark').
  324.      List all holidays for the displayed three months in another window
  325.      (`list-calendar-holidays').
  326. `M-x holidays'
  327.      List all holidays for three months around today's date in another
  328.      window.
  329.    To see if any holidays fall on a given date, position point on that
  330. date in the calendar window and use the `h' command.  Alternatively,
  331. click on that date with `Mouse-2' and then choose `Holidays' from the
  332. menu that appears.  Either way, this displays the holidays for that
  333. date, in the echo area if they fit there, otherwise in a separate
  334. window.
  335.    To view the distribution of holidays for all the dates shown in the
  336. calendar, use the `x' command.  This displays the dates that are
  337. holidays in a different face (or places a `*' after these dates, if
  338. display with multiple faces is not available).  The command applies both
  339. to the currently visible months and to other months that subsequently
  340. become visible by scrolling.  To turn marking off and erase the current
  341. marks, type `u', which also erases any diary marks (*note Diary::.).
  342.    To get even more detailed information, use the `a' command, which
  343. displays a separate buffer containing a list of all holidays in the
  344. current three-month range.  You can use SPC in the calendar window to
  345. scroll that list.
  346.    The command `M-x holidays' displays the list of holidays for the
  347. current month and the preceding and succeeding months; this works even
  348. if you don't have a calendar window.  If you want the list of holidays
  349. centered around a different month, use `C-u M-x holidays', which
  350. prompts for the month and year.
  351.    The holidays known to Emacs include American holidays and the major
  352. Christian, Jewish, and Islamic holidays; also the solstices and
  353. equinoxes.
  354.    The dates used by Emacs for holidays are based on *current
  355. practice*, not historical fact.  Historically, for instance, the start
  356. of daylight savings time and even its existence have varied from year to
  357. year, but present American law mandates that daylight savings time
  358. begins on the first Sunday in April.  In an American locale, Emacs
  359. always uses this definition, even though it is wrong for some prior
  360. years.
  361. File: emacs,  Node: Sunrise/Sunset,  Next: Lunar Phases,  Prev: Holidays,  Up: Calendar/Diary
  362. Times of Sunrise and Sunset
  363. ===========================
  364.    Special calendar commands can tell you, to within a minute or two,
  365. the times of sunrise and sunset for any date.
  366.      Display times of sunrise and sunset for the selected date
  367.      (`calendar-sunrise-sunset').
  368. `Mouse-2 Sunrise/Sunset'
  369.      Display times of sunrise and sunset for the date you click on.
  370. `M-x sunrise-sunset'
  371.      Display times of sunrise and sunset for today's date.
  372. `C-u M-x sunrise-sunset'
  373.      Display times of sunrise and sunset for a specified date.
  374.    Within the calendar, to display the *local times* of sunrise and
  375. sunset in the echo area, move point to the date you want, and type `S'.
  376. Alternatively, click `Mouse-2' on the date, then choose
  377. `Sunrise/Sunset' from the menu that appears.  The command `M-x
  378. sunrise-sunset' is available outside the calendar to display this
  379. information for today's date or a specified date.  To specify a date
  380. other than today, use `C-u M-x sunrise-sunset', which prompts for the
  381. year, month, and day.
  382.    You can display the times of sunrise and sunset for any location and
  383. any date with `C-u C-u M-x sunrise-sunset'.  This asks you for a
  384. longitude, latitude, number of minutes difference from Coordinated
  385. Universal Time, and date, and then tells you the times of sunrise and
  386. sunset for that location on that date.
  387.    Because the times of sunrise and sunset depend on the location on
  388. earth, you need to tell Emacs your latitude, longitude, and location
  389. name before using these commands.  Here is an example of what to set:
  390.      (setq calendar-latitude 40.1)
  391.      (setq calendar-longitude -88.2)
  392.      (setq calendar-location-name "Urbana, IL")
  393. Use one decimal place in the values of `calendar-latitude' and
  394. `calendar-longitude'.
  395.    Your time zone also affects the local time of sunrise and sunset.
  396. Emacs usually gets time zone information from the operating system, but
  397. if these values are not what you want (or if the operating system does
  398. not supply them), you must set them yourself.  Here is an example:
  399.      (setq calendar-time-zone -360)
  400.      (setq calendar-standard-time-zone-name "CST")
  401.      (setq calendar-daylight-time-zone-name "CDT")
  402. The value of `calendar-time-zone' is the number of minutes difference
  403. between your local standard time and Coordinated Universal Time
  404. (Greenwich time).  The values of `calendar-standard-time-zone-name' and
  405. `calendar-daylight-time-zone-name' are the abbreviations used in your
  406. time zone.  Emacs displays the times of sunrise and sunset *corrected
  407. for daylight savings time*.  *Note Daylight Savings::, for how daylight
  408. savings time is determined.
  409.    As a user, you might find it convenient to set the calendar location
  410. variables for your usual physical location in your `.emacs' file.  And
  411. when you install Emacs on a machine, you can create a `default.el' file
  412. which sets them properly for the typical location of most users of that
  413. machine.  *Note Init File::.
  414. File: emacs,  Node: Lunar Phases,  Next: Other Calendars,  Prev: Sunrise/Sunset,  Up: Calendar/Diary
  415. Phases of the Moon
  416. ==================
  417.    These calendar commands display the dates and times of the phases of
  418. the moon (new moon, first quarter, full moon, last quarter).  This
  419. feature is useful for debugging problems that "depend on the phase of
  420. the moon."
  421.      Display the dates and times for all the quarters of the moon for
  422.      the three-month period shown (`calendar-phases-of-moon').
  423. `M-x phases-of-moon'
  424.      Display dates and times of the quarters of the moon for three
  425.      months around today's date.
  426.    Within the calendar, use the `M' command to display a separate
  427. buffer of the phases of the moon for the current three-month range.  The
  428. dates and times listed are accurate to within a few minutes.
  429.    Outside the calendar, use the command `M-x phases-of-moon' to
  430. display the list of the phases of the moon for the current month and the
  431. preceding and succeeding months.  For information about a different
  432. month, use `C-u M-x phases-of-moon', which prompts for the month and
  433. year.
  434.    The dates and times given for the phases of the moon are given in
  435. local time (corrected for daylight savings, when appropriate); but if
  436. the variable `calendar-time-zone' is void, Coordinated Universal Time
  437. (the Greenwich time zone) is used.  *Note Daylight Savings::.
  438. File: emacs,  Node: Other Calendars,  Next: Diary,  Prev: Lunar Phases,  Up: Calendar/Diary
  439. Conversion To and From Other Calendars
  440. ======================================
  441.    The Emacs calendar displayed is *always* the Gregorian calendar,
  442. sometimes called the "new style" calendar, which is used in most of the
  443. world today.  However, this calendar did not exist before the sixteenth
  444. century and was not widely used before the eighteenth century; it did
  445. not fully displace the Julian calendar and gain universal acceptance
  446. until the early twentieth century.  The Emacs calendar can display any
  447. month since January, year 1 of the current era, but the calendar
  448. displayed is the Gregorian, even for a date at which the Gregorian
  449. calendar did not exist.
  450.    While Emacs cannot display other calendars, it can convert dates to
  451. and from several other calendars.
  452. * Menu:
  453. * Calendar Systems::       The calendars Emacs understands
  454.                  (aside from Gregorian).
  455. * To Other Calendar::       Converting the selected date to various calendars.
  456. * From Other Calendar::       Moving to a date specified in another calendar.
  457. * Mayan Calendar::       Moving to a date specified in a Mayan calendar.
  458. File: emacs,  Node: Calendar Systems,  Next: To Other Calendar,  Up: Other Calendars
  459. Supported Calendar Systems
  460. --------------------------
  461.    The ISO commercial calendar is used largely in Europe.
  462.    The Julian calendar, named after Julius Caesar, was the one used in
  463. Europe throughout medieval times, and in many countries up until the
  464. nineteenth century.
  465.    Astronomers use a simple counting of days elapsed since noon, Monday,
  466. January 1, 4713 B.C. on the Julian calendar.  The number of days elapsed
  467. is called the *Julian day number* or the *Astronomical day number*.
  468.    The Hebrew calendar is used by tradition in the Jewish religion.  The
  469. Emacs calendar program uses the Hebrew calendar to determine the dates
  470. of Jewish holidays.  Hebrew calendar dates begin and end at sunset.
  471.    The Islamic calendar is used in many predominantly Islamic countries.
  472. Emacs uses it to determine the dates of Islamic holidays.  There is no
  473. universal agreement in the Islamic world about the calendar; Emacs uses
  474. a widely accepted version, but the precise dates of Islamic holidays
  475. often depend on proclamation by religious authorities, not on
  476. calculations.  As a consequence, the actual dates of observance can vary
  477. slightly from the dates computed by Emacs.  Islamic calendar dates begin
  478. and end at sunset.
  479.    The French Revolutionary calendar was created by the Jacobins after
  480. the 1789 revolution, to represent a more secular and nature-based view
  481. of the annual cycle, and to install a 10-day week in a rationalization
  482. measure similar to the metric system.  The French government officially
  483. abandoned this calendar at the end of 1805.
  484.    The Maya of Central America used three separate, overlapping calendar
  485. systems, the *long count*, the *tzolkin*, and the *haab*.  Emacs knows
  486. about all three of these calendars.  Experts dispute the exact
  487. correlation between the Mayan calendar and our calendar; Emacs uses the
  488. Goodman-Martinez-Thompson correlation in its calculations.
  489.    The Copts use a calendar based on the ancient Egyptian solar
  490. calendar.  Their calendar consists of twelve 30-day months followed by
  491. an extra five day period.  Once every fourth year they add a leap day
  492. to this extra period to make it six days.  The Ethiopic calendar is
  493. identical in structure, but has different year numbers and month names.
  494.    The Persians use a solar calendar based on a design of Omar Khayyam.
  495. Their calendar consists of twelve months of which the first six have 31
  496. days, the next five have 30 days, and the last has 29 in ordinary years
  497. and 30 in leap years.  Leap years occur in a complicated pattern every
  498. four or five years.
  499.    The Chinese calendar is a complicated system of lunar months arranged
  500. into solar years.  The years go in cycles of sixty, each year containing
  501. either twelve months in an ordinary year or thirteen months in a leap
  502. year; each month has either 29 or 30 days.  Years, ordinary months, and
  503. days are named by combining one of ten "celestial stems" with one of
  504. twelve "terrestrial branches" for a total of sixty names that are
  505. repeated in a cycle of sixty.
  506. File: emacs,  Node: To Other Calendar,  Next: From Other Calendar,  Prev: Calendar Systems,  Up: Other Calendars
  507. Converting To Other Calendars
  508. -----------------------------
  509.    The following commands describe the selected date (the date at point)
  510. in various other calendar systems:
  511. `Mouse-2  Other Calendars'
  512.      Display the date that you click on, expressed in various other
  513.      calendars.
  514. `p c'
  515.      Display ISO commercial calendar equivalent for selected day
  516.      (`calendar-print-iso-date').
  517. `p j'
  518.      Display Julian date for selected day
  519.      (`calendar-print-julian-date').
  520. `p a'
  521.      Display astronomical (Julian) day number for selected day
  522.      (`calendar-print-astro-day-number').
  523. `p h'
  524.      Display Hebrew date for selected day
  525.      (`calendar-print-hebrew-date').
  526. `p i'
  527.      Display Islamic date for selected day
  528.      (`calendar-print-islamic-date').
  529. `p f'
  530.      Display French Revolutionary date for selected day
  531.      (`calendar-print-french-date').
  532. `p C'
  533.      Display Chinese date for selected day
  534.      (`calendar-print-chinese-date').
  535. `p k'
  536.      Display Coptic date for selected day
  537.      (`calendar-print-coptic-date').
  538. `p e'
  539.      Display Ethiopic date for selected day
  540.      (`calendar-print-ethiopic-date').
  541. `p p'
  542.      Display Persian date for selected day
  543.      (`calendar-print-persian-date').
  544. `p m'
  545.      Display Mayan date for selected day (`calendar-print-mayan-date').
  546.    If you are using X, the easiest way to translate a date into other
  547. calendars is to click on it with `Mouse-2', then choose `Other
  548. Calendars' from the menu that appears.  This displays the equivalent
  549. forms of the date in all the calendars Emacs understands, in the form of
  550. a menu.  (Choosing an alternative from this menu doesn't actually do
  551. anything--the menu is used only for display.)
  552.    Put point on the desired date of the Gregorian calendar, then type
  553. the appropriate keys.  The `p' is a mnemonic for "print" since Emacs
  554. "prints" the equivalent date in the echo area.
  555. File: emacs,  Node: From Other Calendar,  Next: Mayan Calendar,  Prev: To Other Calendar,  Up: Other Calendars
  556. Converting From Other Calendars
  557. -------------------------------
  558.    You can use the other supported calendars to specify a date to move
  559. to.  This section describes the commands for doing this using calendars
  560. other than Mayan; for the Mayan calendar, see the following section.
  561. `g c'
  562.      Move to a date specified in the ISO commercial calendar
  563.      (`calendar-goto-iso-date').
  564. `g j'
  565.      Move to a date specified in the Julian calendar
  566.      (`calendar-goto-julian-date').
  567. `g a'
  568.      Move to a date specified in astronomical (Julian) day number
  569.      (`calendar-goto-astro-day-number').
  570. `g h'
  571.      Move to a date specified in the Hebrew calendar
  572.      (`calendar-goto-hebrew-date').
  573. `g i'
  574.      Move to a date specified in the Islamic calendar
  575.      (`calendar-goto-islamic-date').
  576. `g f'
  577.      Move to a date specified in the French Revolutionary calendar
  578.      (`calendar-goto-french-date').
  579. `g C'
  580.      Move to a date specified in the Chinese calendar
  581.      (`calendar-goto-chinese-date').
  582. `g p'
  583.      Move to a date specified in the Persian calendar
  584.      (`calendar-goto-persian-date').
  585. `g k'
  586.      Move to a date specified in the Coptic calendar
  587.      (`calendar-goto-coptic-date').
  588. `g e'
  589.      Move to a date specified in the Ethiopic calendar
  590.      (`calendar-goto-ethiopic-date').
  591.    These commands ask you for a date on the other calendar, move point
  592. to the Gregorian calendar date equivalent to that date, and display the
  593. other calendar's date in the echo area.  Emacs uses strict completion
  594. (*note Completion::.) whenever it asks you to type a month name, so you
  595. don't have to worry about the spelling of Hebrew, Islamic, or French
  596. names.
  597.    One common question concerning the Hebrew calendar is the computation
  598. of the anniversary of a date of death, called a "yahrzeit."  The Emacs
  599. calendar includes a facility for such calculations.  If you are in the
  600. calendar, the command `M-x list-yahrzeit-dates' asks you for a range of
  601. years and then displays a list of the yahrzeit dates for those years
  602. for the date given by point.  If you are not in the calendar, this
  603. command first asks you for the date of death and the range of years,
  604. and then displays the list of yahrzeit dates.
  605. File: emacs,  Node: Mayan Calendar,  Prev: From Other Calendar,  Up: Other Calendars
  606. Converting from the Mayan Calendar
  607. ----------------------------------
  608.    Here are the commands to select dates based on the Mayan calendar:
  609. `g m l'
  610.      Move to a date specified by the long count calendar
  611.      (`calendar-goto-mayan-long-count-date').
  612. `g m n t'
  613.      Move to the next occurrence of a place in the tzolkin calendar
  614.      (`calendar-next-tzolkin-date').
  615. `g m p t'
  616.      Move to the previous occurrence of a place in the tzolkin calendar
  617.      (`calendar-previous-tzolkin-date').
  618. `g m n h'
  619.      Move to the next occurrence of a place in the haab calendar
  620.      (`calendar-next-haab-date').
  621. `g m p h'
  622.      Move to the previous occurrence of a place in the haab calendar
  623.      (`calendar-previous-haab-date').
  624. `g m n c'
  625.      Move to the next occurrence of a place in the calendar round
  626.      (`calendar-next-calendar-round-date').
  627. `g m p c'
  628.      Move to the previous occurrence of a place in the calendar round
  629.      (`calendar-previous-calendar-round-date').
  630.    To understand these commands, you need to understand the Mayan
  631. calendars.  The "long count" is a counting of days with these units:
  632.      1 kin = 1 day   1 uinal = 20 kin   1 tun = 18 uinal
  633.      1 katun = 20 tun   1 baktun = 20 katun
  634. Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
  635. tun, 16 uinal, and 6 kin.  The Emacs calendar can handle Mayan long
  636. count dates as early as 7.17.18.13.1, but no earlier.  When you use the
  637. `g m l' command, type the Mayan long count date with the baktun, katun,
  638. tun, uinal, and kin separated by periods.
  639.    The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
  640. independent cycles of 13 and 20 days.  Since this cycle repeats
  641. endlessly, Emacs provides commands to move backward and forward to the
  642. previous or next point in the cycle.  Type `g m p t' to go to the
  643. previous tzolkin date; Emacs asks you for a tzolkin date and moves point
  644. to the previous occurrence of that date.  Similarly, type `g m n t' to
  645. go to the next occurrence of a tzolkin date.
  646.    The Mayan haab calendar is a cycle of 365 days arranged as 18 months
  647. of 20 days each, followed a 5-day monthless period.  Like the tzolkin
  648. cycle, this cycle repeats endlessly, and there are commands to move
  649. backward and forward to the previous or next point in the cycle.  Type
  650. `g m p h' to go to the previous haab date; Emacs asks you for a haab
  651. date and moves point to the previous occurrence of that date.
  652. Similarly, type `g m n h' to go to the next occurrence of a haab date.
  653.    The Maya also used the combination of the tzolkin date and the haab
  654. date.  This combination is a cycle of about 52 years called a *calendar
  655. round*.  If you type `g m p c', Emacs asks you for both a haab and a
  656. tzolkin date and then moves point to the previous occurrence of that
  657. combination.  Use `g m n c' to move point to the next occurrence of a
  658. combination.  These commands signal an error if the haab/tzolkin date
  659. combination you have typed is impossible.
  660.    Emacs uses strict completion (*note Strict Completion::.) whenever it
  661. asks you to type a Mayan name, so you don't have to worry about
  662. spelling.
  663. File: emacs,  Node: Diary,  Next: Appointments,  Prev: Other Calendars,  Up: Calendar/Diary
  664. The Diary
  665. =========
  666.    The Emacs diary keeps track of appointments or other events on a
  667. daily basis, in conjunction with the calendar.  To use the diary
  668. feature, you must first create a "diary file" containing a list of
  669. events and their dates.  Then Emacs can automatically pick out and
  670. display the events for today, for the immediate future, or for any
  671. specified date.
  672.    By default, Emacs uses `~/diary' as the diary file.  This is the
  673. same file that the `calendar' utility uses.  A sample `~/diary' file is:
  674.      12/22/1988  Twentieth wedding anniversary!!
  675.      &1/1.       Happy New Year!
  676.      10/22       Ruth's birthday.
  677.      * 21, *:    Payday
  678.      Tuesday--weekly meeting with grad students at 10am
  679.               Supowit, Shen, Bitner, and Kapoor to attend.
  680.      1/13/89     Friday the thirteenth!!
  681.      &thu 4pm    squash game with Lloyd.
  682.      mar 16      Dad's birthday
  683.      April 15, 1989 Income tax due.
  684.      &* 15       time cards due.
  685. This example uses extra spaces to align the event descriptions of most
  686. of the entries.  Such formatting is purely a matter of taste.
  687.    Although you probably will start by creating a diary manually, Emacs
  688. provides a number of commands to let you view, add, and change diary
  689. entries.
  690. * Menu:
  691. * Diary Commands::         Viewing diary entries and associated calendar dates.
  692. * Format of Diary File::   Entering events in your diary.
  693. * Date Formats::       Various ways you can specify dates.
  694. * Adding to Diary::       Commands to create diary entries.
  695. * Special Diary Entries::  Anniversaries, blocks of dates, cyclic entries, etc.
  696. File: emacs,  Node: Diary Commands,  Next: Format of Diary File,  Up: Diary
  697. Commands Displaying Diary Entries
  698. ---------------------------------
  699.    Once you have created a `~/diary' file, you can use the calendar to
  700. view it.  You can also view today's events outside of Calendar mode.
  701.      Display all diary entries for the selected date
  702.      (`view-diary-entries').
  703. `Mouse-2 Diary'
  704.      Display all diary entries for the date you click on.
  705.      Display the entire diary file (`show-all-diary-entries').
  706.      Mark all visible dates that have diary entries
  707.      (`mark-diary-entries').
  708.      Unmark the calendar window (`calendar-unmark').
  709. `M-x print-diary-entries'
  710.      Print hard copy of the diary display as it appears.
  711. `M-x diary'
  712.      Display all diary entries for today's date.
  713.    Displaying the diary entries with `d' shows in a separate window the
  714. diary entries for the selected date in the calendar.  The mode line of
  715. the new window shows the date of the diary entries and any holidays
  716. that fall on that date.  If you specify a numeric argument with `d', it
  717. shows all the diary entries for that many successive days.  Thus, `2 d'
  718. displays all the entries for the selected date and for the following
  719.    Another way to display the diary entries for a date is to click
  720. `Mouse-2' on the date, and then choose `Diary' from the menu that
  721. appears.
  722.    To get a broader view of which days are mentioned in the diary, use
  723. the `m' command.  This displays the dates that have diary entries fall
  724. in a different face (or places a `+' after these dates, if display with
  725. multiple faces is not available).  The command applies both to the
  726. currently visible months and to other months that subsequently become
  727. visible by scrolling.  To turn marking off and erase the current marks,
  728. type `u', which also turns off holiday marks (*note Holidays::.).
  729.    To see the full diary file, rather than just some of the entries, use
  730. the `s' command.
  731.    Display of selected diary entries uses the selective display feature
  732. to hide entries that don't apply.  This is the same feature that Outline
  733. mode uses to show part of an outline (*note Outline Mode::.).
  734.    The diary buffer as you see it is an illusion, so simply printing the
  735. buffer does not print what you see on your screen.  There is a special
  736. command to print hard copy of the diary buffer *as it appears*; this
  737. command is `M-x print-diary-entries'.  It sends the data directly to
  738. the printer.  You can customize it like `lpr-region' (*note
  739. Hardcopy::.).
  740.    The command `M-x diary' displays the diary entries for the current
  741. date, independently of the calendar display, and optionally for the next
  742. few days as well; the variable `number-of-diary-entries' specifies how
  743. many days to include.  *Note Calendar/Diary Options:
  744. (elisp)Calendar/Diary Options.
  745.    If you put `(diary)' in your `.emacs' file, this automatically
  746. displays a window with the day's diary entries, when you enter Emacs.
  747. The mode line of the displayed window shows the date and any holidays
  748. that fall on that date.
  749. File: emacs,  Node: Format of Diary File,  Next: Date Formats,  Prev: Diary Commands,  Up: Diary
  750. The Diary File
  751. --------------
  752.    Your "diary file" is a file that records events associated with
  753. particular dates.  The name of the diary file is specified by the
  754. variable `diary-file'; `~/diary' is the default.  The `calendar'
  755. utility program supports a subset of the format allowed by the Emacs
  756. diary facilities, so you can use that utility to view the diary file,
  757. with reasonable results aside from the entries it cannot understand.
  758.    Each entry in the diary file describes one event and consists of one
  759. or more lines.  An entry always begins with a date specification at the
  760. left margin.  The rest of the entry is simply text to describe the
  761. event.  If the entry has more than one line, then the lines after the
  762. first must begin with whitespace to indicate they continue a previous
  763. entry.  Lines that do not begin with valid dates and do not continue a
  764. preceding entry are ignored.
  765.    You can inhibit the marking of certain diary entries in the calendar
  766. window; to do this, insert an ampersand (`&') at the beginning of the
  767. entry, before the date.  This has no effect on display of the entry in
  768. the diary window; it affects only marks on dates in the calendar
  769. window.  Nonmarking entries are especially useful for generic entries
  770. that would otherwise mark many different dates.
  771.    If the first line of a diary entry consists only of the date or day
  772. name with no following blanks or punctuation, then the diary window
  773. display doesn't include that line; only the continuation lines appear.
  774. For example, this entry:
  775.      02/11/1989
  776.            Bill B. visits Princeton today
  777.            2pm Cognitive Studies Committee meeting
  778.            2:30-5:30 Liz at Lawrenceville
  779.            4:00pm Dentist appt
  780.            7:30pm Dinner at George's
  781.            8:00-10:00pm concert
  782. appears in the diary window without the date line at the beginning.
  783. This style of entry looks neater when you display just a single day's
  784. entries, but can cause confusion if you ask for more than one day's
  785. entries.
  786.    You can edit the diary entries as they appear in the window, but it
  787. is important to remember that the buffer displayed contains the *entire*
  788. diary file, with portions of it concealed from view.  This means, for
  789. instance, that the `C-f' (`forward-char') command can put point at what
  790. appears to be the end of the line, but what is in reality the middle of
  791. some concealed line.
  792.    *Be careful when editing the diary entries!*  Inserting additional
  793. lines or adding/deleting characters in the middle of a visible line
  794. cannot cause problems, but editing at the end of a line may not do what
  795. you expect.  Deleting a line may delete other invisible entries that
  796. follow it.  Before editing the diary, it is best to display the entire
  797. file with `s' (`show-all-diary-entries').
  798. File: emacs,  Node: Date Formats,  Next: Adding to Diary,  Prev: Format of Diary File,  Up: Diary
  799. Date Formats
  800. ------------
  801.    Here are some sample diary entries, illustrating different ways of
  802. formatting a date.  The examples all show dates in American order
  803. (month, day, year), but Calendar mode supports European order (day,
  804. month, year) as an option.
  805.      4/20/93  Switch-over to new tabulation system
  806.      apr. 25  Start tabulating annual results
  807.      4/30  Results for April are due
  808.      */25  Monthly cycle finishes
  809.      Friday  Don't leave without backing up files
  810.    The first entry appears only once, on April 20, 1993.  The second and
  811. third appear every year on the specified dates, and the fourth uses a
  812. wildcard (asterisk) for the month, so it appears on the 25th of every
  813. month.  The final entry appears every week on Friday.
  814.    You can use just numbers to express a date, as in `MONTH/DAY' or
  815. `MONTH/DAY/YEAR'.  This must be followed by a nondigit.  In the date
  816. itself, MONTH and DAY are numbers of one or two digits.  The optional
  817. YEAR is also a number, and may be abbreviated to the last two digits;
  818. that is, you can use `11/12/1989' or `11/12/89'.
  819.    Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY,
  820. YEAR', where the month's name can be spelled in full or abbreviated to
  821. three characters (with or without a period).  Case is not significant.
  822.    A date may be "generic"; that is, partially unspecified.  Then the
  823. entry applies to all dates that match the specification.  If the date
  824. does not contain a year, it is generic and applies to any year.
  825. Alternatively, MONTH, DAY, or YEAR can be a `*'; this matches any
  826. month, day, or year, respectively.  Thus, a diary entry `3/*/*' matches
  827. any day in March of any year; so does `march *'.
  828.    If you prefer the European style of writing dates--in which the day
  829. comes before the month--type `M-x european-calendar' while in the
  830. calendar, or set the variable `european-calendar-style' to `t' *before*
  831. using any calendar or diary command.  This mode interprets all dates in
  832. the diary in the European manner, and also uses European style for
  833. displaying diary dates.  (Note that there is no comma after the
  834. MONTHNAME in the European style.)  To go back to the (default) American
  835. style of writing dates, type `M-x american-calendar'.
  836.    You can use the name of a day of the week as a generic date which
  837. applies to any date falling on that day of the week.  You can abbreviate
  838. the day of the week to three letters (with or without a period) or spell
  839. it in full; case is not significant.
  840. File: emacs,  Node: Adding to Diary,  Next: Special Diary Entries,  Prev: Date Formats,  Up: Diary
  841. Commands to Add to the Diary
  842. ----------------------------
  843.    While in the calendar, there are several commands to create diary
  844. entries:
  845. `i d'
  846.      Add a diary entry for the selected date (`insert-diary-entry').
  847. `i w'
  848.      Add a diary entry for the selected day of the week
  849.      (`insert-weekly-diary-entry').
  850. `i m'
  851.      Add a diary entry for the selected day of the month
  852.      (`insert-monthly-diary-entry').
  853. `i y'
  854.      Add a diary entry for the selected day of the year
  855.      (`insert-yearly-diary-entry').
  856.    You can make a diary entry for a specific date by selecting that date
  857. in the calendar window and typing the `i d' command.  This command
  858. displays the end of your diary file in another window and inserts the
  859. date; you can then type the rest of the diary entry.
  860.    If you want to make a diary entry that applies to a specific day of
  861. the week, select that day of the week (any occurrence will do) and type
  862. `i w'.  This inserts the day-of-week as a generic date; you can then
  863. type the rest of the diary entry.  You can make a monthly diary entry in
  864. the same fashion.  Select the day of the month, use the `i m' command,
  865. and type rest of the entry.  Similarly, you can insert a yearly diary
  866. entry with the `i y' command.
  867.    All of the above commands make marking diary entries by default.  To
  868. make a nonmarking diary entry, give a numeric argument to the command.
  869. For example, `C-u i w' makes a nonmarking weekly diary entry.
  870.    When you modify the diary file, be sure to save the file before
  871. exiting Emacs.
  872.